# -*- encoding: utf-8 -*-
'''
@File        : Rpc_client_test.py
@License     : (C)Copyright 2021 LeeRoc (cn) Lipeng
@Modify Time : 2021/7/30 6:42 下午 
@Author      : LeeRoc
@Version     : 1.0
@Description :
'''
import xmlrpc.client

from config.Config import *

# Read xml config file
hosts = Get_Cluster_Ip_By_Conf().Get_host()
print(hosts)

# s = xmlrpc.client.ServerProxy('http://%s:%s' % (hosts[0][1], 8000))
# [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:661)
# 这里用的'http://'，不是'https'，这是这个错误的主要源头
s = xmlrpc.client.ServerProxy('http://172.16.199.128:8000')
s.distribute(['172.16.199.128', '22', 'lee', '123456'], '/Users/leeroc/Desktop/Client.png', '../data/b.png')

# Print list of available methods
print(s.system.listMethods())